package com.earth.controller;

import com.earth.entity.Admin;
import com.earth.service.IAdminService;
import com.earth.utils.api.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhengxincheng
 * @since 2024-06-27
 */
@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private IAdminService adminService;

    @PostMapping("/list")
    public CommonResult<List<Admin>> list(){
        return CommonResult.success(adminService.list());
    }
}
